import sys


def func(x: int):
    yin = []
    for i in range(1, x+1):
        if x/i == x//i:
            yin.append(str(i))
    return ''.join(yin)


if __name__ == '__main__':
    count = 0
    n_k = sys.stdin.readline().strip()
    sequence = sys.stdin.readline().strip()
    n, k =n_k.split(' ')
    seq = sequence.split(' ')

    for s_int in seq:
        s = func(int(s_int))
        for i in range(0, len(s)-len(k)+1):
            if s[i:i+len(k)] == k:
                count += 1
    print(count)